<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>其他用户作品</title>
    <link href="./bootstrap-3.3.7-dist/css/bootstrap.min.css" rel=" stylesheet">
    <script src="./js/jquery-3.4.1.min.js"></script>
    <script src="./bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
    <link href="./css/goods.css" rel=" stylesheet">
    <style th:include="include/footer :: style"></style>
    <style th:include="include/navstyle :: styletwo"></style>
</head>
<body>
<header>
    <nav th:include="include/navstyle :: nav"></nav>
</header>
<section>
    <div class="box">
        <div><a th:href="@{usergoods}" class="goodsone" onclick="photoone()"><img th:src="@{${filename0}}" onerror="src='./image/imgbackground.png';" width="100%" height="100%"></a></div>
        <div><a th:href="@{usergoods}" class="goodstwo" onclick="phototwo()"><img th:src="@{${filename1}}" onerror="src='./image/imgbackground.png';" width="100%" height="100%"></a></div>
        <div><a th:href="@{usergoods}" class="goodsthree" onclick="photothree()"><img th:src="@{${filename2}}" onerror="src='./image/imgbackground.png';" width="100%" height="100%"></a></div>
        <div><a th:href="@{usergoods}" class="goodsfour" onclick="photofour()"><img th:src="@{${filename3}}" onerror="src='./image/imgbackground.png';" width="100%" height="100%"></a></div>
        <div><a th:href="@{usergoods}" class="goodsfive" onclick="photofive()"><img th:src="@{${filename4}}" onerror="src='./image/imgbackground.png';" width="100%" height="100%"></a></div>
        <div><a th:href="@{usergoods}" class="goodssix" onclick="photosix()"><img th:src="@{${filename5}}" onerror="src='./image/imgbackground.png';" width="100%" height="100%"></a></div>
        <div><a th:href="@{usergoods}" class="goodsseven" onclick="photoseven()"><img th:src="@{${filename6}}" onerror="src='./image/imgbackground.png';" width="100%" height="100%"></a></div>
        <div><a th:href="@{usergoods}" class="goodseight" onclick="photoeight()"><img th:src="@{${filename7}}" onerror="src='./image/imgbackground.png';" width="100%" height="100%"></a></div>
    </div>
</section>
<footer th:include="include/footer :: footer">
</footer>
<script>




    function photoone() {
        var imgsrc0 = $(".goodsone").find("img").attr('src');
        var src = imgsrc0.substring(0, imgsrc0.length - 5);
        $.ajax({
            url: "http://localhost:8080/goods",
            type: "POST",
            dataType: "text",
            traditional: true,
            data: {
                "path": src
            }
        });
    }

    function phototwo() {
        var imgsrc = $(".goodstwo").find("img").attr('src');
        var src = imgsrc.substring(0, imgsrc.length - 5);
        console.log(imgsrc);
        $.ajax({
            url: "http://localhost:8080/goods",
            type: "POST",
            dataType: "text",
            traditional: true,
            data: {
                "path": src
            }
        });
    }

    function photothree() {
        var imgsrc = $(".goodsthree").find("img").attr('src');
        var src = imgsrc.substring(0, imgsrc.length - 5);
        $.ajax({
            url: "http://localhost:8080/goods",
            type: "POST",
            dataType: "text",
            traditional: true,
            data: {
                "path": src
            }
        });
    }
    function photofour() {
        var imgsrc = $(".goodsfour").find("img").attr('src');
        var src = imgsrc.substring(0, imgsrc.length - 5);
        $.ajax({
            url: "http://localhost:8080/goods",
            type: "POST",
            dataType: "text",
            traditional: true,
            data: {
                "path": src
            }
        });
    }
    function photofive() {
        var imgsrc = $(".goodsfive").find("img").attr('src');
        var src = imgsrc.substring(0, imgsrc.length - 5);
        $.ajax({
            url: "http://localhost:8080/goods",
            type: "POST",
            dataType: "text",
            traditional: true,
            data: {
                "path": src
            }
        });
    }
    function photosix() {
        var imgsrc = $(".goodssix").find("img").attr('src');
        var src = imgsrc.substring(0, imgsrc.length - 5);
        $.ajax({
            url: "http://localhost:8080/goods",
            type: "POST",
            dataType: "text",
            traditional: true,
            data: {
                "path": src
            }
        });
    }
    function photoseven() {
        var imgsrc = $(".goodsseven").find("img").attr('src');
        var src = imgsrc.substring(0, imgsrc.length - 5);
        $.ajax({
            url: "http://localhost:8080/goods",
            type: "POST",
            dataType: "text",
            traditional: true,
            data: {
                "path": src
            }
        });
    }
    function photoeight() {
        var imgsrc = $(".goodseight").find("img").attr('src');
        var src = imgsrc.substring(0, imgsrc.length - 5);
        $.ajax({
            url: "http://localhost:8080/goods",
            type: "POST",
            dataType: "text",
            traditional: true,
            data: {
                "path": src
            }
        });
    }
</script>
</body>
</html>